package com.sy.dao.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.sy.dao.BaseDao;
import com.sy.vo.Sshnews;

@SuppressWarnings("unchecked")
public class SshnewsDaoImpl extends HibernateDaoSupport{

	public BaseDao dao;
	
	public void addNews(Sshnews sshnews) {
		dao.addObject(sshnews);
	}

	public void delete(Serializable id) {
		dao.removeObject(Sshnews.class, id);
	}

	public Sshnews getNews(Serializable id) {
		return (Sshnews)dao.getObject(Sshnews.class, id);
	}

	public List listNews() {
		return getHibernateTemplate().find("from Sshnews order by id desc");
	}

	public void updateNews(Sshnews sshnews) {
		dao.saveOrUpdateObject(sshnews);
	}

	public void setDao(BaseDao dao) {
		this.dao=dao;
	}
}